#ifndef _CLASS_MODULE
#define _CLASS_MODULE
#include 'class.lib.js'
#include 'console.lib.js'
#include 'xhr.lib.js'

var Module = new Class({
	construct: function() {
		this.name_lowercase = this.name.toLowerCase();
	},
	log: function( action ) {
		Console.log( [{
			name: 'Script',
			value: this.name
		},
		{
			name: 'Action',
			value: action
		}] );
		Console.status(this.name_lowercase, action);
	},
	ajax: function( details ) {
		xhr( details, this );
	},
	ajax_parse: function( resp, callback ) {
		Page.captcha( resp );
		if (Page.pausing === true) {
			Page.pause_cb( callback );
			return true;
		};
		Boss.update( resp );
		return false;
	},
	stop: function() {
		Page.toggle( this.name_lowercase );
	}
});
#endif